import { Provide } from '@midwayjs/core';
import { Inventory } from '../entity/Inventory';
import { InjectEntityModel } from '@midwayjs/orm';
import { Repository } from 'typeorm';
import { BaseService } from './base';

@Provide()
export class InventoryService extends BaseService<Inventory> {
  @InjectEntityModel(Inventory)
  entity: Repository<Inventory>;

  async add(data) {
    return await super.add(data);
  }

  async update(data) {
    return await super.update(data);
  }

  async upsert(data) {
    return await super.upsert(data, { conflictPaths: ['id'] });
  }
}
